package org.grayrabbit.cms.plugin.loaders.classloading;

import java.io.File;

public class DeploymentUnit {
	private final File path;
	public DeploymentUnit(File path)
	  {
	    if (path == null)
	    {
	      throw new IllegalArgumentException("File should not be null!");
	    }
	    this.path = path;
	  }
	
	public File getPath()
	  {
	    return this.path;
	  }

	public long lastModified() {
		return this.path.lastModified();
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
	    if (!(o instanceof DeploymentUnit)) return false;

	    DeploymentUnit deploymentUnit = (DeploymentUnit)o;

	    return this.path.equals(deploymentUnit.path);
	}

	@Override
	public int hashCode() {
		return this.path.hashCode();
	} 
}
